#include <cstdio>
#include <iostream>

using namespace std;

#define MAXN	(1<<27)
#define MAXP	(1<<24)
#define MOD		1000003

char sieves[MAXN];
int primes[MAXP];

int sieve(int n)
{
	int total = 0;
	for (int i = 2; i < n; i++) {
		if (!sieves[i])
			primes[total++] = i;

		for (int j = 0; j < total && primes[j]*i <= n; j++) {
			sieves[i * primes[j]] = 1;
			if (i % primes[j] == 0)
				break;
		}
	}
	return total;
}

int wilson(int n, int p)
{
	int r = 0, x = p;
	while (1) {
		int t = n / x;
		r += t;
		if (t == 0)
			break;
		x *= p;
	}
	return r;
}

int main()
{
	int n, m;
	cin >> n >> m;

	int total = sieve(n);
	int r = 1;
	for (int i = 0; i < total; i++) {
		int p = primes[i];
		int x = wilson(n, p), y = wilson(n-m, p), z = wilson(m, p);
		printf("%d! contains %d %ds, %d! contains %d %ds, %d! contains %d %ds, totals %d %ds\n",
			n, x, p, n-m, y, p, m, z, p, x-y-z, p);
		for (int j = 0; j < x-y-z; j++)
			r = (r * p) % MOD;
	}
	printf("%d\n", r);
}
